import { createApp } from 'vue'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import {router} from "./router/index.js";
import axios from 'axios'
import App from './App.vue'

const app = createApp(App)
    app.use(ElementPlus)
    app.use(router)

    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
        app.component(key, component)
    }
    //定义图片地址全局变量，所有组件都可以使用
    app.config.globalProperties.$urlImage = 'http://localhost:8080/images/';
    // 将 axios 挂载到全局
    app.config.globalProperties.$axios = axios
    // 是否在启动时生成生产提示
    app.config.productionTip = false
    // 指定 axios 的全局配置，指定为后端服务器地址
    axios.defaults.baseURL = 'http://localhost:8080/'

    app.mount('#app')
